SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE [dbo].gspSiteUserSiteEvent_SEARCH
(
@userId int = null,
@eventId int = null,
@createDate datetime = null,
@isDeleted bit = null
)
AS

SELECT
  *
FROM
  [dbo].[SiteUser_SiteEvent]
WHERE
  (@userId IS NULL OR [UserId] = @userId)
AND
  (@eventId IS NULL OR [EventId] = @eventId)
AND
  (@createDate IS NULL OR [CreateDate] = @createDate)
AND
  (@isDeleted IS NULL OR [IsDeleted] = @isDeleted)

GO
